home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / InvalidClassException.java < prev    next >
Text File  |  1998-09-22  |  2KB  |  64 lines

  1. /*
  2.  * @(#)InvalidClassException.java    1.6 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /**
  18.  * Raised when the Serialization runtime detects a problem with a Class.
  19.  * The class may: <UL>
  20.  * <LI> not match the serial version of the class in the stream
  21.  * <LI> the class contains unknown datatypes
  22.  * <LI> the class implements only one of writeObject or readObject methods
  23.  * <LI> the class is not public
  24.  * <LI> the class does not have an accessible no-arg constructor
  25.  * </UL>
  26.  *
  27.  * @author  unascribed
  28.  * @version 1.6, 07/01/98
  29.  * @since   JDK1.1
  30.  */
  31. public class InvalidClassException extends ObjectStreamException {
  32.     /**
  33.      * @since   JDK1.1
  34.      */
  35.     public String classname;
  36.  
  37.     /**
  38.      * Report a InvalidClassException for the specified reason.
  39.      * @since   JDK1.1
  40.      */
  41.     public InvalidClassException(String reason) {
  42.     super(reason);
  43.     }
  44.  
  45.     /**
  46.      * @since   JDK1.1
  47.      */
  48.     public InvalidClassException(String cname, String reason) {
  49.     super(reason);
  50.     classname = cname;
  51.     }
  52.  
  53.     /**
  54.      * Produce the message, include the classname if present.
  55.      * @since   JDK1.1
  56.      */
  57.     public String getMessage() {
  58.     if (classname == null) 
  59.         return super.getMessage();
  60.     else
  61.         return classname + "; " + super.getMessage();
  62.     }
  63. }
  64.